package cn.learn.test.infrastructure;

import cn.learn.infrastructure.persistent.dao.IRaffleActivityCountDao;
import cn.learn.infrastructure.persistent.dao.IRaffleActivityDao;
import cn.learn.infrastructure.persistent.dao.IRaffleActivitySkuDao;
import cn.learn.infrastructure.persistent.po.RaffleActivity;
import cn.learn.infrastructure.persistent.po.RaffleActivityCount;
import cn.learn.infrastructure.persistent.po.RaffleActivitySku;
import com.alibaba.fastjson2.JSON;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

/**
 * @author Sun
 * @Desc
 * @date 2024-11-11-12:24
 */

@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class RaffleActivityDaoTest {

    @Resource
    private IRaffleActivityDao raffleActivityDao;

    @Resource
    private IRaffleActivityCountDao raffleActivityCountDao;
    @Resource
    private IRaffleActivitySkuDao raffleActivitySkuDao;

    @Test
    public void test_queryRaffleActivityById(){
        RaffleActivity raffleActivity = raffleActivityDao.queryRaffleActivityByActivityId(100301L);
        log.info("测试结果：{}", JSON.toJSONString(raffleActivity));
    }

    @Test
    public void test_queryActivitySku(){
        RaffleActivitySku raffleActivitySku = raffleActivitySkuDao.queryActivitySku(9011L);
        log.info("测试结果：{}", JSON.toJSONString(raffleActivitySku));
    }

    @Test
    public void test_queryRaffleActivityCountByActivityCountId(){
        RaffleActivityCount raffleActivityCount = raffleActivityCountDao.queryRaffleActivityCountByActivityCountId(11101L);
        log.info("测试结果：{}", JSON.toJSONString(raffleActivityCount));
    }

}
